package com.cloud.goldapp.contriller;

import com.cloud.goldapp.entity.Good;
import com.cloud.goldapp.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodController {

    @Autowired
    private GoodService goodService;

    @GetMapping("/list")
    public List<Good> findAll() {

        return goodService.findAll();
    }

}
